<?
	require("koneksi.php");
	$nrp=$_GET['nrp'];
	//$queryganjil = mysql_query("select * from sks where nrp='$nrp' and periode like '1%'");
	//$rowganjil=mysql_fetch_row($queryganjil);
	$getyearnrp=substr($nrp,4,1);
	$tahun=date(y);
	$length = strlen($tahun);
	$bulan=date(m);

	$i = 1;
		for($t=$getyearnrp;$t<=$tahun;$t++)
		{ 
			{	
				$query_ganjil = mysql_query("select * from sks where nrp='$nrp' and periode like '1/0$t%' order by periode asc");
				$query_genap = mysql_query("select * from sks where nrp='$nrp' and periode like '2/0$t%' order by periode asc");
				
				$semester = (($tahun-$getyearnrp)*2)+1;
				
				if ($i < $semester) 
				{
					echo "Semester : $i\n"; $i++;
				}
				while($row_ganjil=mysql_fetch_row($query_ganjil))
				{  	
					echo "Nama : $row_ganjil[2]\n"; 
					echo "Nilai : $row_ganjil[4]\n";
				}
				echo "\n";
				if ($i < $semester) 
				{
					echo "Semester : $i\n"; $i++;
				}
				while($row_genap=mysql_fetch_row($query_genap))
				{
					echo "Nama : $row_genap[2]\n"; 
					echo "Nilai : $row_genap[4]\n";
				}
				echo "\n";
			}
		}
			
?>